﻿using MangaGrr.DomainModel;

namespace MangaGrr.Logic
{
    class MangaPageDownloader
    {
        private readonly MangaPage _mangaPage;

        public MangaPageDownloader(MangaPage mangaPage)
        {
            _mangaPage = mangaPage;
        }

        /// <summary>
        /// Try downloading a Page. If fail then retry after each given interval
        /// </summary>
        internal void Download(string folderPath, int interval)
        {
            MGRUtil.TryDownload(_mangaPage, folderPath, 1000);
        }
    }
}
